import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { UserManagementComponent } from './user-management/user-management.component';
import { RoleManagementComponent } from './role-management/role-management.component';
import { SystemConfigComponent } from './system-config.component';
import { NoticeRuleComponent } from './notice-rule/notice-rule.component';
import { StateAbnormalityComponent } from './state-abnormality/state-abnormality.component';
import { SmsConfigComponent } from './sms-config/sms-config.component';
import { OperationLogsComponent } from './operation-logs/operation-logs.component';
import { PermissionManagementComponent } from './permission-management/permission-management.component';
import { AppRouteGuard } from '@shared/common/auth/auth-route-app-guard';
import { SiteTypeConfigComponent } from './site-type-config/site-type-config.component';

const routes: Routes = [

  {
    path: '',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: SystemConfigComponent,
    data: { breadcrumb_no_url: 'system_config' },
    children: [
      {
        path: 'users',
        component: UserManagementComponent,
        data: { permission: 'A5_B11_', activeMenu: 'user', tabBelong: 'user', breadcrumb: 'user_manage' }
      },


      {
        path: 'roles',
        component: RoleManagementComponent,
        data: { permission: 'A5_B12_', activeMenu: 'role', tabBelong: 'role', breadcrumb: 'role_manage' }
      },
      {
        path: 'permissions',
        component: PermissionManagementComponent,
        data: { permission: 'A5_B12_', activeMenu: 'role', tabBelong: 'role', breadcrumb: 'role_manage' }
      },


      {
        path: 'noticeRule',
        component: NoticeRuleComponent,
        data: { permission: 'A5_B13_', activeMenu: 'rule', tabBelong: 'rule', breadcrumb: 'monitor_config_manage' }
      },
      {
        path: 'stateAbnormality',
        component: StateAbnormalityComponent,
        data: { permission: 'A5_B13_', activeMenu: 'rule', tabBelong: 'rule', breadcrumb: 'monitor_config_manage' }
      },
      {
        path: 'smsConfig',
        component: SmsConfigComponent,
        data: { permission: 'A5_B13_', activeMenu: 'rule', tabBelong: 'rule', breadcrumb: 'monitor_config_manage' }
      },

      
      {
        path: 'siteType',
        component: SiteTypeConfigComponent,
        data: { permission: 'A5_',activeMenu: 'rule',tabBelong: 'rule', breadcrumb:'site_type_config'}
      },

      {
        path: 'logs',
        component: OperationLogsComponent,
        data: { permission: 'A5_B14_', activeMenu: 'log', tabBelong: 'log', breadcrumb: 'operation_log' }
      }
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class SystemConfigRoutingModule { }
